package com.ampaiva.db;

import java.io.Serializable;
import java.util.List;

import com.ampaiva.pattern.Child;

public class TableInfo implements Serializable {
    private static final long serialVersionUID = -3274927097497145199L;
    private String name;
    private Child<TableInfo, ColumnInfo> columnsInfo;

    public TableInfo(String tableName, List<ColumnInfo> columnsInfo) {
        setName(tableName);
        this.setColumnsInfo(new Child<TableInfo, ColumnInfo>(this, columnsInfo));
    }

    public String getName() {
        return name;
    }

    private void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return getName();
    }

    public Child<TableInfo, ColumnInfo> getColumnsInfo() {
        return columnsInfo;
    }

    void setColumnsInfo(Child<TableInfo, ColumnInfo> columnsInfo) {
        this.columnsInfo = columnsInfo;
    }

}
